import { PoolManager } from 'db://assets/Scripts/Framework/Managers/PoolManager';
import { InGameManager } from '../Managers/InGameManager';
import { Weapon } from './Weapon';

export class Melee extends Weapon {

    canUse: boolean = true;
    range = 0;

    static Init(_num: number): Melee {
        let data = InGameManager.itemsJson.Melee[_num];
        let melee = PoolManager.GetItem(Melee);
        melee.num = 1;
        melee.itemName = data.name;
        melee.damage = data.damage;
        melee.armorExpose = data.armorExpose;
        melee.rate = data.rate;
        melee.range = data.range;
        melee.sfUrl = data.spriteFrame;
        melee.weaponSfUrl = data.weaponSpriteFrame;
        melee.prefabUrl = data.prefab;
        return melee;
    }

}